Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
¿Qué está causando este error "Datos base64 ilegales"?

He estado trabajando en un proyecto usando Next y GraphQL y me está costando averiguar qué está causando el siguiente error:

ClientError: GraphQL Error (Code: 400): {"response":{"error":"{\"errors\":[{\"message\":\"parse token failed: illegal base64 data at input byte 0\"}],\"data\":null}","status":400,"headers":{}},"request":{"query":"mutation CreateComment($name: String!, $email: String!, $comment: String!, $slug: String!) {createComment(data: {name: $name, email: $email, comment: $comment, post: { connect: { slug: $slug } } }) { id }}","variables":{"name":"Nate","email":"dasdasd@asasd","comment":"test","slug":"test-slug"}}}

Y aquí está mi consulta. Intenté eliminar los espacios superfluos y los errores ortográficos que detecté. El token funciona bien y todo lo demás parece estar bien, aparte del error:

 console.log(graphcmsToken) const { name, email, slug, comment } = req.body; const graphQLClient = new GraphQLClient(graphqlAPI, { headers: { authorization: `Bearer ${graphcmsToken}`} }) const query = gql`mutation CreateComment($name: String!, $email: String!, $comment: String!, $slug: String!) {createComment(data: {name: $name, email: $email, comment: $comment, post: { connect: { slug: $slug } } }) { id }}` try { const result = await graphQLClient.request(query, req.body) return res.status(200).send(result); } catch (error){ console.log(error) return res.status(500).send(error) }

¡Gracias por adelantado! Esto me ha dejado perplejo durante más tiempo del que me gustaría admitir, y cuando trato de buscar una respuesta aquí, no he tenido mucha suerte con JS/Next/GraphQL en particular.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El problema estaba en el token: copiarlo y pegarlo había agregado un formato adicional que estaba causando problemas.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!